{% extends 'generic/object_list.html' %}
{% load helpers %}

{% block buttons %}
    <div class="dropdown">
        <button class="btn btn-secondary dropdown-toggle" type="button" id="max_length" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
            Max Length{% if "prefix_length__lte" in request.GET %}: {{ request.GET.prefix_length__lte }}{% endif %}
            <span class="mdi mdi-chevron-down"></span>
        </button>
        <ul class="dropdown-menu" aria-labelledby="max_length">
            {% for i in "4,8,12,16,20,24,28,32,40,48,56,64"|split %}
                <li>
                    <a class="dropdown-item"
                       href="{% url 'ipam:prefix_list' %}{% legacy_querystring request prefix_length__lte=i page=1 %}">
                        {{ i }} {% if request.GET.prefix_length__lte == i %}<span class="mdi mdi-check-bold"></span>{% endif %}
                    </a>
                </li>
            {% endfor %}
        </ul>
    </div>
{% endblock %}
